package com.nfit.shopadmin.mapper;

import com.nfit.shopmodel.entity.product.ProductSku;
import com.nfit.shopmodel.vo.h5.indexCarouselVo;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.math.BigDecimal;
import java.util.List;

/**
 * ClassName:ProductSkuMapper
 * Package:com.nfit.shopadmin.mapper
 * Description
 *
 * @Author L
 * @Create 2024/12/18 15:26
 */
@Mapper
public interface ProductSkuMapper {

    /**
     * 移动端首页轮播图图片
     */
    List<ProductSku> getImage();

    /**
     * 根据商品id查询对应商品缩略图，和sku最低价格
     * @param id 商品id
     */
    ProductSku findByProductId(Long id);

    List<ProductSku> findByProductIdSkus(Long id);

    ProductSku getProductSkuInfo(Long skuId);

    /**
     * 更新库存信息
     * @param skuId skuId
     * @param stock 库存数量
     */
    void renewStock(@Param("skuId") Long skuId,@Param("stock") Integer stock);

    Integer getStock(Long skuId);
}
